<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="com.engine.kq.biz.KQGroupMemberComInfo" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>


<%@ include file="/systeminfo/init_wev8.jsp" %>

<%
    //数据库操作
    RecordSet rs = new RecordSet();
    RecordSet rsPb = new RecordSet();
    //获取当前登录人的id
    String strUserid = Util.null2String(user.getUID());
    //考勤组id
    String strGroupid = "";
    //获取当前日期
    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
    String strCurrDate = simpleDateFormat.format(new Date());


    //先查询排班配置表里是否存在此人员
    String pbSql = "select kqz from uf_pbcdqxpzb where pbgly=?";
    rsPb.executeQuery(pbSql, strUserid);
    if (rsPb.next()) {
        strGroupid = Util.null2String(rsPb.getString("kqz"));
    } else {

        //查询当前人所在的考勤组id
        KQGroupMemberComInfo kqGroupMemberComInfo = new KQGroupMemberComInfo();
        strGroupid = kqGroupMemberComInfo.getKQGroupId(strUserid, strCurrDate);
//        String strSql = "select groupid from kq_format_total where resourceid=? and kqdate=?";
//        rs.executeQuery(strSql, strUserid, strCurrDate);
//        if (rs.next()) {
//            strGroupid = Util.null2String(rs.getString("groupid"));
//        }
    }
    new BaseBean().writeLog("当前考勤组id:" + strGroupid);


    response.sendRedirect("/spa/hrm/staticAttendance4engine/engine.html#/attendance/scheduleSetting/" + strGroupid);


%>